@import '~src/themes.less';

.@{css-prefix}-check-controller {
  position: absolute;
  left: 0;

  &.is-checked .@{css-prefix}-check-controller-inner {
    background-color: @color-primary;
    border-color: darken(@color-primary, 10%);

    &.is-checkbox:after {
      transform: rotate(45deg) scaleY(1);
    }

    &.is-radio:after {
      transform: translate(-50%, -50%) scale(1);
    }
  }

  .@{css-prefix}-check-controller-inner {
    display: inline-block;
    position: relative;
    border: 1px solid @border-color;
    border-radius: 2px;
    vertical-align: middle;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    background-color: #fff;
    z-index: 1;
    cursor: pointer;
    transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
      background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);

    &:after {
      box-sizing: content-box;
      content: '';
      border: 2px solid #fff;
      border-left: 0;
      border-top: 0;
      height: 8px;
      left: 4px;
      position: absolute;
      top: 1px;
      transform: rotate(45deg) scaleY(0);
      width: 4px;
      transition: transform 0.15s cubic-bezier(0.71, -0.46, 0.88, 0.6) 0.05s;
      transform-origin: center;
    }

    &.is-radio {
      border-radius: 100%;

      &:after {
        border-radius: 100%;
        height: 4px;
        background-color: #fff;
        left: 50%;
        top: 50%;
      }
    }
  }

  .@{css-prefix}-check-controller-original {
    opacity: 0;
    outline: none;
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
  }
}
